package com.itheima.edu.info.a;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class f {
    public static void main(String[] args) throws ParseException {
        String ks = "2021-10-02 10:30:00";
        String js = "2021-10-02 10:40:00";
        String xm = "2021-10-02 10:35:27";
        String xh = "2021-10-02 10:41:53";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long Ks = sdf.parse(ks).getTime();
        long Js = sdf.parse(js).getTime();
        long Xm = sdf.parse(xm).getTime();
        long Xh = sdf.parse(xh).getTime();
        if (Ks <= Xm && Js >= Xm) {
            System.out.println("小明抢到了");
        } else {
            System.out.println("小明超过时间");
        }
        if (Ks <= Xh && Js >= Xh) {
            System.out.println("小花抢到了");
        } else {
            System.out.println("小花超过时间");
        }
    }
}
